class Teacher {
private:
    std::string name;
    std::string subject;
    int yearsOfExperience;
    double salary;

public:
    // 构造函数
    Teacher(const std::string& n, const std::string& s, int y, double sal) 
        : name(n), subject(s), yearsOfExperience(y), salary(sal) {}

    // 访问器函数
    const std::string& getName() const { return name; }
    const std::string& getSubject() const { return subject; }
    int getYearsOfExperience() const { return yearsOfExperience; }
    double getSalary() const { return salary; }

    // 修改器函数
    void setName(const std::string& n) { name = n; }
    void setSubject(const std::string& s) { subject = s; }
    void setYearsOfExperience(int y) { yearsOfExperience = y; }
    void setSalary(double sal) { salary = sal; }

    // 其他成员函数
    void giveLesson() {
        std::cout << name << " is giving a " << subject << " lesson." << std::endl;
    }

    void receiveRaise(double percentage) {
        salary *= (1 + percentage);
    }
};